import request from '@/utils/request'
import axios from 'axios'
import { getToken } from '@/api/common'


const baseURL = process.env.VUE_APP_API_BASE_URL

export function getLogList(parameter) {
  return request({
    url: '/log/operLog/list',
    method: 'get',
    params: parameter
  })
}

export function getAccessLogList(parameter) {
  return request({
    url: '/log/accessLog/list',
    method: 'get',
    params: parameter
  })
}

export function getOperTypeList() {
  return request({
    url: '/log/operLog/typeList',
    method: 'get',
  })
}

export function exportLogList() {
  return axios({
    url: `${baseURL}/log/operLog/export`,
    method: 'get',
    responseType: 'arraybuffer',
    headers: {
      jxtoken: getToken()
    }
  })
}

export function exportAccessLogList() {
  return axios({
    url: `${baseURL}/log/accessLog/export`,
    method: 'get',
    responseType: 'arraybuffer',
    headers: {
      jxtoken: getToken()
    }
  })
}